using System;
using UnityEngine;

[Serializable]
public class CharacterActions : MonoBehaviour
{
	public WaypointMover waypointMover;

	public AnimationClip idleAnimation;

	public AnimationClip moveAnimation;

	public AnimationClip jumpAnimation;

	public Vector3 jumpForce;

	private bool inSpecialAction;

	public void Update()
	{
		if (!inSpecialAction)
		{
			if (waypointMover.isMoving())
			{
				Move();
			}
			else
			{
				Idle();
			}
		}
		else if (!GetComponent<Animation>().isPlaying)
		{
			inSpecialAction = false;
		}
	}

	public void Idle()
	{
		if (!GetComponent<Animation>().isPlaying || GetComponent<Animation>().IsPlaying(moveAnimation.name))
		{
			GetComponent<Animation>().Play(idleAnimation.name);
		}
	}

	public void Move()
	{
		if (GetComponent<Animation>().isPlaying)
		{
			GetComponent<Animation>().Play(moveAnimation.name);
		}
	}

	public void Jump()
	{
		inSpecialAction = true;
		GetComponent<Animation>().Play(jumpAnimation.name);
		GetComponent<Rigidbody>().AddRelativeForce(jumpForce, ForceMode.Impulse);
	}

	public void Main()
	{
	}
}
